<?php

namespace App\Policies;

use App\Models\Child;
use App\Models\Family;
use App\Models\User;
use Illuminate\Auth\Access\HandlesAuthorization;
use Illuminate\Support\Facades\Log;

class ChildPolicy
{
    use HandlesAuthorization;

    /**
     * Create a new policy instance.
     *
     * @return void
     */
    public function __construct()
    {
        //
    }
    public function allow(User $user, Child $child)
    {
        return $user->id == $child->user_id;
    }

    public function family(Family $family, Child $child){
        return $family->phone == $child->phone;
    }
}
